home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / OSAGeneric.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  3.8 KB  |  137 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        OSAGeneric.h
  3.  
  4.      Contains:    AppleScript Generic Component Interfaces.
  5.  
  6.      Version:    Technology:    AppleScript 1.1
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1992-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __OSAGENERIC__
  19. #define __OSAGENERIC__
  20.  
  21. #ifndef __ERRORS__
  22. #include <Errors.h>
  23. #endif
  24. #ifndef __APPLEEVENTS__
  25. #include <AppleEvents.h>
  26. #endif
  27. #ifndef __OSA__
  28. #include <OSA.h>
  29. #endif
  30.  
  31.  
  32.  
  33. #if PRAGMA_ONCE
  34. #pragma once
  35. #endif
  36.  
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40.  
  41. #if PRAGMA_IMPORT
  42. #pragma import on
  43. #endif
  44.  
  45. #if PRAGMA_STRUCT_ALIGN
  46.     #pragma options align=mac68k
  47. #elif PRAGMA_STRUCT_PACKPUSH
  48.     #pragma pack(push, 2)
  49. #elif PRAGMA_STRUCT_PACK
  50.     #pragma pack(2)
  51. #endif
  52.  
  53. /*     NOTE:    This interface defines a "generic scripting component."
  54.             The Generic Scripting Component allows automatic dispatch to a
  55.             specific scripting component that conforms to the OSA interface.
  56.             This component supports OSA, by calling AppleScript or some other 
  57.             scripting component.  Additionally it provides access to the default
  58.             and the user-prefered scripting component.
  59. */
  60.  
  61.  
  62.  
  63. enum {
  64.                                                                 /* Component version this header file describes */
  65.     kGenericComponentVersion    = 0x0100
  66. };
  67.  
  68.  
  69. enum {
  70.     kGSSSelectGetDefaultScriptingComponent = 0x1001,
  71.     kGSSSelectSetDefaultScriptingComponent = 0x1002,
  72.     kGSSSelectGetScriptingComponent = 0x1003,
  73.     kGSSSelectGetScriptingComponentFromStored = 0x1004,
  74.     kGSSSelectGenericToRealID    = 0x1005,
  75.     kGSSSelectRealToGenericID    = 0x1006,
  76.     kGSSSelectOutOfRange        = 0x1007
  77. };
  78.  
  79. typedef OSType                             ScriptingComponentSelector;
  80. typedef OSAID                             GenericID;
  81. /* get and set the default scripting component */
  82. EXTERN_API( OSAError )
  83. OSAGetDefaultScriptingComponent    (ComponentInstance         genericScriptingComponent,
  84.                                  ScriptingComponentSelector * scriptingSubType)                FIVEWORDINLINE(0x2F3C, 0x0004, 0x1001, 0x7000, 0xA82A);
  85.  
  86. EXTERN_API( OSAError )
  87. OSASetDefaultScriptingComponent    (ComponentInstance         genericScriptingComponent,
  88.                                  ScriptingComponentSelector  scriptingSubType)                FIVEWORDINLINE(0x2F3C, 0x0004, 0x1002, 0x7000, 0xA82A);
  89.  
  90. /* get a scripting component instance from its subtype code */
  91. EXTERN_API( OSAError )
  92. OSAGetScriptingComponent        (ComponentInstance         genericScriptingComponent,
  93.                                  ScriptingComponentSelector  scriptingSubType,
  94.                                  ComponentInstance *    scriptingInstance)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x1003, 0x7000, 0xA82A);
  95.  
  96. /* get a scripting component selector (subType) from a stored script */
  97. EXTERN_API( OSAError )
  98. OSAGetScriptingComponentFromStored (ComponentInstance     genericScriptingComponent,
  99.                                  const AEDesc *            scriptData,
  100.                                  ScriptingComponentSelector * scriptingSubType)                FIVEWORDINLINE(0x2F3C, 0x0008, 0x1004, 0x7000, 0xA82A);
  101.  
  102. /* get a real component instance and script id from a generic id */
  103. EXTERN_API( OSAError )
  104. OSAGenericToRealID                (ComponentInstance         genericScriptingComponent,
  105.                                  OSAID *                theScriptID,
  106.                                  ComponentInstance *    theExactComponent)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x1005, 0x7000, 0xA82A);
  107.  
  108. /* get a generic id from a real component instance and script id */
  109. EXTERN_API( OSAError )
  110. OSARealToGenericID                (ComponentInstance         genericScriptingComponent,
  111.                                  OSAID *                theScriptID,
  112.                                  ComponentInstance         theExactComponent)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x1006, 0x7000, 0xA82A);
  113.  
  114.  
  115.  
  116.  
  117. #if PRAGMA_STRUCT_ALIGN
  118.     #pragma options align=reset
  119. #elif PRAGMA_STRUCT_PACKPUSH
  120.     #pragma pack(pop)
  121. #elif PRAGMA_STRUCT_PACK
  122.     #pragma pack()
  123. #endif
  124.  
  125. #ifdef PRAGMA_IMPORT_OFF
  126. #pragma import off
  127. #elif PRAGMA_IMPORT
  128. #pragma import reset
  129. #endif
  130.  
  131. #ifdef __cplusplus
  132. }
  133. #endif
  134.  
  135. #endif /* __OSAGENERIC__ */
  136.  
  137.